<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20101227;15110000">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.27in 11.69in }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<P><BR><BR>
</P>
<P STYLE="text-decoration: none"><FONT SIZE=6 STYLE="font-size: 22pt"><B>Multidimensional
quadrature</B></FONT></P>
<P STYLE="text-decoration: none"><FONT SIZE=6 STYLE="font-size: 22pt"><B>tricub</B></FONT></P>
<P>Evaluate the double integral 
</P>
<P><IMG SRC="tricub_html_1fe90e41.gif" NAME="Object1" ALIGN=ABSMIDDLE HSPACE=8 WIDTH=161 HEIGHT=26 BORDER=0></P>
<P>over the triangle Ω in the x-y plane with vertices (0, 0), (0,
π/2), (π/2, π/2).</P>
<P><BR><BR>
</P>
<P><B>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E
to open the editor)</B></P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">import
java.text.DecimalFormat;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">import numal.*;</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public class Test_tricub
extends Object implements AE_tricub_method {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public static void
main(String args[]) {</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">int i;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">double acc;</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">Test_tricub testtricub = new
Test_tricub();</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">DecimalFormat oneDigit = new
DecimalFormat(&quot;0.0E0&quot;);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">DecimalFormat fiveDigit = new
DecimalFormat(&quot;0.00000E0&quot;);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">System.out.println(&quot;TRICUB
delivers:&quot;);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">acc=1.0;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">for (i=0; i&lt;=5; i++) {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">acc *= 1.0e-1;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">System.out.println(&quot; &quot;
+ oneDigit.format(acc) + &quot; &quot; +</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">fiveDigit.format(Analytic_eval.tricub(0.0,0.0,0.0,</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">Math.PI/2.0,Math.PI/2.0,Math.PI/2.0,testtricub,acc,acc)));</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public double g(double x,
double y) {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">return
Math.cos(x)*Math.cos(y);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
</BODY>
</HTML>